// 异步请求相关运行配置
import { message } from 'antd';

export const request = {
  requestInterceptors: [
    (url, options) => {
      // console.log('请求', url, options)
      options.url = 'https://429iornr.lc-cn-n1-shared.com/1.1' + url;
      options.headers = {
        "X-LC-Id": "429IoRnrGLxV0qs2nvxfYTcO-gzGzoHsz",
        "X-LC-Key": "pexMKOvG8HW9ldQ5asRRvzlO",
        "Content-Type": "application/json"
      }
      return options;
    }
  ],
  responseInterceptors: [
    async (response, options) => {
      let res = await response.json();
      if (res.objectId && options.method.toLowerCase() == 'post') {
        message.success('新增成功');
      }
      console.log('响应', res, options)
      return res;
    }
  ]
};